<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/website/layout/tag.jsp"%>
<script type="text/javascript">
	$(document).ready( 
		function() {
			//事件注册.
			$("#saveBtn").click(saveRole);
			$("#returnBtn").click(returnToList);
			
			//设置左菜单对应菜单CSS为选中状态.
			changeToActiveCss("menu_7015");
			
			//消息显示.
			var msg = '<c:out value="${msg}"/>';
			if (msg != "") {
				alert(msg);
			}
		}
	);
	
	function saveRole() {
		//表单校验
		var name = $.trim($("#name").val());
		if (name == "") {
			alert("角色名称不能为空.");
			$("#name").focus();
			return false;
		}
		
		if (!confirm("保存角色信息吗?")) {
			return false;
		}
	
		var action = $("#editForm").attr("action");
		action += "?oper=" + '<c:out value="${oper}"/>';
		$("#editForm").attr("action", action);
		$("#editForm").submit();
	}
	
	function returnToList() {
		window.location.href='${pageContext.request.contextPath}/system/enterRoleList.action';
	}
</script>

<div id="content_right">
	<div style="width:100%;height:35px;line-height:35px;text-align:left;background-color:#F5FAFA;font-weight:bold; ">系统管理 > 管理员 > 角色列表 > 编辑角色</div>
	<div>
		<div id="tabBar">
			<span class="curentTab">角色信息</span>
		</div>
		<div class="buttons" style="float:right; ">
			<a id="saveBtn" href="#"><!-- class="regular"-->
				<img src="../images/btn_apply.png" alt=""/> 
				保存
			</a>
			<a id="returnBtn" href="#"><!-- class="regular"-->
				<img src="../images/btn_apply.png" alt=""/> 
				返回列表
			</a>
		</div>
	</div>
	<div id="editContainer">
		<div id="baseInfo" class="editPanel">
			<div style="float:left; width:100%;margin-left:10px;">
				<table class="infoTable">
					<tr>
						<th>角色名称：</th>
					</tr>
					<tr>
						<th>角色描述：</th>
						<td>
						</td>
					</tr>
					<tr>
						<th>权限选择：</th>
						<td>
							<div id="roleDiv" style="height:150px;">
							</div>
						</td>
					</tr>
				</table>
			</div>
			<div style="clear:both;"></div>
		</div>
	</div>
</div>
